/*   1:    */ package com.atomikos.beans;
/*   2:    */ 
/*   3:    */ import java.awt.Component;
/*   4:    */ import java.beans.PropertyEditorSupport;
/*   5:    */ 
/*   6:    */ public class DefaultPropertyEditor
/*   7:    */   extends PropertyEditorSupport
/*   8:    */ {
/*   9:    */   private String[] tags_;
/*  10:    */   private PropertyEditorComponent component_;
/*  11:    */   
/*  12:    */   public DefaultPropertyEditor(PropertyEditorComponent component, String[] tags)
/*  13:    */   {
/*  14: 59 */     this.tags_ = tags;
/*  15: 60 */     this.component_ = component;
/*  16: 61 */     this.component_.init(this);
/*  17:    */   }
/*  18:    */   
/*  19:    */   public String[] getTags()
/*  20:    */   {
/*  21: 72 */     return this.tags_;
/*  22:    */   }
/*  23:    */   
/*  24:    */   public boolean isPaintable()
/*  25:    */   {
/*  26: 82 */     return false;
/*  27:    */   }
/*  28:    */   
/*  29:    */   public void setAsText(String text)
/*  30:    */   {
/*  31: 92 */     boolean allowedValue = true;
/*  32: 94 */     if (this.tags_ != null)
/*  33:    */     {
/*  34: 95 */       allowedValue = false;
/*  35: 96 */       for (int i = 0; i < this.tags_.length; i++) {
/*  36: 97 */         if (this.tags_[i].equals(text)) {
/*  37: 98 */           allowedValue = true;
/*  38:    */         }
/*  39:    */       }
/*  40:    */     }
/*  41:102 */     if (allowedValue) {
/*  42:103 */       super.setValue(text);
/*  43:    */     } else {
/*  44:106 */       throw new IllegalArgumentException("Value not allowed: " + text);
/*  45:    */     }
/*  46:    */   }
/*  47:    */   
/*  48:    */   public String getJavaInitializationString()
/*  49:    */   {
/*  50:113 */     throw new RuntimeException("Not implemented");
/*  51:    */   }
/*  52:    */   
/*  53:    */   public boolean supportsCustomEditor()
/*  54:    */   {
/*  55:118 */     return this.component_ != null;
/*  56:    */   }
/*  57:    */   
/*  58:    */   public Component getCustomEditor()
/*  59:    */   {
/*  60:123 */     Component ret = null;
/*  61:125 */     if (this.component_ != null) {
/*  62:126 */       ret = this.component_.getComponent();
/*  63:    */     }
/*  64:129 */     return ret;
/*  65:    */   }
/*  66:    */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\atomikos-util\3.7.0\atomikos-util-3.7.0.jar
 * Qualified Name:     com.atomikos.beans.DefaultPropertyEditor
 * JD-Core Version:    0.7.0.1
 */